/**
 * 作者: wgx
 * 日期: 2025-05-19 16:23:01
 * 备注: 自动开服配置表(新版怪兽都市)
 */
package com.motu.vertx.module.utility.commondata;

import io.vertx.core.json.JsonObject;

public class ServeropenConfigModel {
    protected int id; // id
    protected String serverName; // 服务器名字 (简体中文)
    protected byte worldChat; // 是否开启跨服聊天
    protected int serverGroup; // 服务器跨服分组
    protected String des; // 维护状态描述
    protected byte type; // 0-定量开服,1-定点开服
    protected byte checkType; // 开服条件0-设备排重,1-角色等级
    protected int param; // 定量开服时，条件参数
    protected int param2; // 定量开服时，条件参数2
    protected String hour; // 定点开服配置的时间点
    protected String feishubot; // 飞书地址
    protected int intervalDay; // 间隔天数,控制开服频率
    protected long nextTime; // 下次开服的最小时间,有设置间隔天数,开服成功时写入
    protected String startTime; // 开服起始时间00:15:00
    protected String endTime; // 开服截止时间21:59:59
    protected int serverNum; // 同时开N个服
    protected int periodicTime; // 定时任务的间隔时间(秒)
    protected int isClose; // 是否关闭自动开服,默认开启 (0-开启中,1-关闭)
    protected String week; // 周几开服 [1,5,7]
    protected String gameName; // 预警提示的游戏名称

    public ServeropenConfigModel() {
    }

    public ServeropenConfigModel(JsonObject obj) {
        id = obj.containsKey("id") ? obj.getInteger("id") : 0;
        serverName = obj.containsKey("server_name") ? obj.getString("server_name") : "";
        worldChat = obj.containsKey("world_chat") ? obj.getInteger("world_chat").byteValue() : 0;
        serverGroup = obj.containsKey("server_group") ? obj.getInteger("server_group") : 0;
        des = obj.containsKey("des") ? obj.getString("des") : "";
        type = obj.containsKey("type") ? obj.getInteger("type").byteValue() : 0;
        checkType = obj.containsKey("check_type") ? obj.getInteger("check_type").byteValue() : 0;
        param = obj.containsKey("param") ? obj.getInteger("param") : 0;
        param2 = obj.containsKey("param2") ? obj.getInteger("param2") : 0;
        hour = obj.containsKey("hour") ? obj.getString("hour") : "";
        feishubot = obj.containsKey("feishubot") ? obj.getString("feishubot") : "";
        intervalDay = obj.containsKey("interval_day") ? obj.getInteger("interval_day") : 0;
        nextTime = obj.containsKey("next_time") ? obj.getLong("next_time") : 0;
        startTime = obj.containsKey("start_time") ? obj.getString("start_time") : "";
        endTime = obj.containsKey("end_time") ? obj.getString("end_time") : "";
        serverNum = obj.containsKey("server_num") ? obj.getInteger("server_num") : 0;
        periodicTime = obj.containsKey("periodic_time") ? obj.getInteger("periodic_time") : 0;
        isClose = obj.containsKey("is_close") ? obj.getInteger("is_close") : 0;
        week = obj.containsKey("week") ? obj.getString("week") : "";
        gameName = obj.containsKey("game_name") ? obj.getString("game_name") : "";
    }

    public int getId() {
        return id;
    }

    public String getServerName() {
        return serverName;
    }

    public byte getWorldChat() {
        return worldChat;
    }

    public int getServerGroup() {
        return serverGroup;
    }

    public String getDes() {
        return des;
    }

    public byte getType() {
        return type;
    }

    public byte getCheckType() {
        return checkType;
    }

    public int getParam() {
        return param;
    }

    public int getParam2() {
        return param2;
    }

    public String getHour() {
        return hour;
    }

    public String getFeishubot() {
        return feishubot;
    }

    public int getIntervalDay() {
        return intervalDay;
    }

    public long getNextTime() {
        return nextTime;
    }

    public String getStartTime() {
        return startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public int getServerNum() {
        return serverNum;
    }

    public int getPeriodicTime() {
        return periodicTime;
    }

    public int getIsClose() {
        return isClose;
    }

    public String getWeek() {
        return week;
    }

    public String getGameName() {
        return gameName;
    }

}
